import {getSchool} from '../../utils/apis';

var app = getApp();
Page({
    data: {
        school: []
    },
    onLoad(options) {
        this.loadData();
    },
    loadData() {
        this.setData({
            'school':app.globalData.schoolList
        })
        // var that = this;
        // getSchool({
        //     success: (data) => {
        //         that.setData({
        //             school: data
        //         })
        //     }
        // })
    },
    changeAddress({target = {}}) {
        wx.setStorageSync('address', target.dataset);
        wx.switchTab({
            url: '/pages/seller/index',
            success: function (e) {
                var page = getCurrentPages().pop();
                if (page === undefined || page == null) return;
                page.setData({
                    sellerList:null,
                    offset:0
                });
                page.onLoad();
            }
        });
    }

});